package org.demo.core.service.person;

import java.util.List;

import org.demo.base.dao.PersonDAO;
import org.demo.domain.person.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class PersonServiceImpl implements PersonService {

	/* ---- Instance Variables ---- */

	@Autowired
	private PersonDAO personDAO = null;

	/* ---- Business Methods ---- */

	@Override
	@Transactional (propagation = Propagation.REQUIRED, readOnly = true)
	public List<Person> findAll() {
		return personDAO.findAll();
	}

	@Override
	@Transactional (propagation = Propagation.REQUIRED, readOnly = true)
	public Person get(Integer id) {
		return personDAO.get(id);
	}

	/* ---- Instance Variables ---- */

	public PersonDAO getPersonDAO() {
		return personDAO;
	}

	public void setPersonDAO(PersonDAO personDAO) {
		this.personDAO = personDAO;
	}

}
